Skip to content

WIP: work: start a resumed worktree at its pushed PR head - #1144

Open
oxa-agent[bot] wants to merge 2 commits into
mainfrom
oxa/issue-1006
Open

oxa-agent[bot] wants to merge 2 commits into
mainfrom
oxa/issue-1006

Conversation

@oxa-agent

@oxa-agent oxa-agent Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Preservation draft for task i1006. Work is not submitted for review. CI and completion evidence remain pending; do not approve or merge this WIP.

Fixes #1052

Resuming a PR from a retained worktree audited whatever commit the earlier run
left there. When the PR branch was pushed on from elsewhere, the local branch
still pointed at the older commit, so the worker read an obsolete tree and a
later push could drop the commits made in between.

Before the base merge, a retained worktree whose lone remote-tracking tip of the
same branch strictly extends its HEAD now starts at that published head through
the sandboxed supervisor, as an ordinary fast-forward. No fetch, reset or force
update is added: a tip that is not ahead, several diverging tips or a dangling
tracking ref keep the retained commits, and a tip that stops being a
fast-forward refuses the resume instead of rewriting it. The initial commit
recorded for the run is taken after the advance.

Tests: work_continue resumes a worktree after the PR branch was pushed on from
another clone and checks the worktree head and tree, and checks that a pushed
head the local commit is not an ancestor of is left untouched.

Fixes #1006
@oxa-orchestrator
oxa-orchestrator Bot marked this pull request as ready for review November 17, 2026 18:16
@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

First-pass review by oxa → oxc → chatgpt/gpt-6.1-sol at head c5d156b (O-241; the orchestrator adjudicates and enqueues).

  • P2 — oxa/oxa-cli/tests/work_continue.rs:44–45: resumed_worktree_starts_at_the_pushed_pr_head fails during fixture setup, before exercising the fix. elsewhere is cloned before agent/test is pushed, so it has neither that local branch nor origin/agent/test. Pushing from project does not update the other clone; its subsequent checkout fails and the git helper panics. Push before cloning, or fetch in elsewhere before checkout.

TIER: T3
VERDICT: REVISE

🤖 Generated with Claude Code (oxa review lane)

The resumed-worktree tests cloned the second checkout before `agent/test`
existed on the remote, because oxa itself never pushes: a work run leaves the
branch local. The clone therefore had only a remote-tracking ref for it, and
the DWIM `git checkout agent/test` failed with "pathspec 'agent/test' did not
match any file(s) known to git", failing the lane on the push-elsewhere fixture
rather than on the resume behaviour it tests.

Publish the branch from the source checkout first and start the clone's branch
from `origin/agent/test` explicitly. The worktree and tree assertions are
unchanged.

Fixes #1006
@oxa-agent
oxa-agent Bot marked this pull request as draft November 17, 2026 18:29
@oxa-orchestrator
oxa-orchestrator Bot marked this pull request as ready for review November 17, 2026 18:32
@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Duplicate cleanup (issue #1052). Closed siblings (heads archived, branches kept): #1051 and #1033 (same existing-branch pushed-head fix, tree.rs only; nothing further to port). #1097 stays open: it covers the new-branch-at-published-head case, a different part.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dogfood: Worktree started at the PR base instead of the PR head

1 participant